<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
		<span name="xxx">aaa</span>
		<span>aaa</span>
		<span>aaa</span>
		<p name="xxx">aaa</p>
		<input type="text" id="userno" name="userno" value="xxx">

		<input type="button" value="button" onclick="test()">
		<script type="text/javascript">
			function test() {
				//var obj=document.getElementById("userno");
				var obj = document.getElementsByTagName("span");
				//alert(3);
				for(var i=0;i<obj.length;i++){
					obj[i].innerHTML="ppp";
				}
				
				var obj2 = document.getElementsByName("xxx");
				obj2[0].innerHTML="bbb";
				//obj.innerHTML = "PPP";
				//obj.value="yyy";
				//alert(obj.value);
			}
		</script>
	</body>

</html>